﻿using System;
using DevelopTool.Common;
using DevelopTool.Forms.LodingForm;
using System.IO;
using Sunny.UI;
using DevelopTool.Forms.Properties;

namespace DevelopTool.Forms.CommonControls
{
    public partial class MiniblinkWebBrowserControl : UIUserControl
    {
        public Miniblink.MiniblinkBrowser Browser;

        public MiniblinkWebBrowserControl()
        {
            string miniblinkDLLPath = Path.Combine(GlobalData.DLLFilePath,"miniblink_4975_x64.dll");
            //将Miniblink动态库解压到程序存储目录
            if(!File.Exists(miniblinkDLLPath))
            {
                LoadingHelper.ShowLoading("首次使用需要加载浏览器组件，请稍后",() =>
                {
                    ZipHelper.DecompressZipFileToDir(Resources.miniblink_4975_x64,Path.GetDirectoryName(miniblinkDLLPath));
                });
            }

            InitializeComponent();
            Browser = this.miniblinkBrowser;            
        }

        private void MiniblinkWebBrowserControl_Load(object sender,EventArgs e)
        {
            
        }
    }
}
